module.exports = function ($scope, $state, $stateParams,$resource,$modal,info,$modalInstance,toaster, flag) {
  console.log(info);
  console.log($stateParams.type)
  console.log(flag);
  $scope.passinfo = info;   
  if ($stateParams.type == '0' && flag == 'ggbohui'){
    url = '/api/as/ggc/reviewGuide/updateDivisionDown';
  } else if ($stateParams.type == '0' && flag == 'tuihui') {
    url = '/api/as/ggc/reviewGuide/updateDirsDown';
  } else if($stateParams.type == '1' && flag == 'ggbohui'){
    url = '/api/as/ggc/reviewGuide/updateDivisionsDown'
  }  else if ($stateParams.type == '1' && flag == 'tuihui') {
      url = 'api/as/ggc/reviewGuide/updateDirssDown';
  } else if($stateParams.type == '2' && flag == 'ggbohui'){
    url = '/api/as/ggc/reviewGuide/updateImporpantDown'
  } else if($stateParams.type == '2' && flag == 'tuihui'){
    url = 'api/as/ggc/reviewGuide/updateDirLeaDown ';
  }
  $scope.ok = function(){
    if(confirm('确认要驳回吗？')==true){
    para = {
      'id' : info.id,
      'no_state_message' : $scope.no_state_message
    }
    $resource(url, {}, {}).
				save(para,function(res) {
					if (res.errcode != 0) {
						toaster.error({title:"驳回失败",body:res.errmsg});
						return;
					} else {
            toaster.success({title:"驳回成功",body:res.errmsg});
            $modalInstance.close();
					}
				});

  } 
}
  $scope.close = function(){
      $modalInstance.close();
  }
};
